# property  私有属性访问
class Person:
    def __init__(self):
        self.__name = 'tqq'
        self.age = '18'

    def set_name(self, name):
        self.__name = name

    def get_name(self):
        return self.__name

    name = property(get_name,set_name)

p = Person()
p.name = 'ss'
print(p.name)


# 装饰器修饰
class Peopel:
    @property
    def name(self):
        return self.__name

    @name.setter
    def name(self, name):
        self.__name = name

p = Peopel()
p.name='tqqq'
print(p.name)
